#cmake最低版本需求，不加入此行会受到警告信息
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

cmake_policy(SET CMP0020 NEW)
 #项目名称
PROJECT(QtReflection)
file(GLOB_RECURSE CURRENT_HEADERS  *.h *.hpp)
source_group("Include" FILES ${CURRENT_HEADERS})

#添加cpp或c文件路径
aux_source_directory(./ SRC_MAIN)


FIND_PACKAGE(Qt5 COMPONENTS core Widgets REQUIRED)

QT5_WRAP_CPP(MOC_Files ${CURRENT_HEADERS})

#生成应用程序 hello (在windows下会自动生成hello.exe)
ADD_EXECUTABLE(${PROJECT_NAME} ${MOC_Files} ${SRC_MAIN} ${CURRENT_HEADERS})

target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Widgets Qt5::Core)